Skip to main content

GRPC and Protobuffers

To run the ProtoC command - use the below snippet

protoc --go_out=. --go_opt=paths=source_relative \
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
protobuffers/api.proto

Set up your .proto file as example from below

syntax = "proto3";

option go_package = "lukas8219/grpc-playground";

package playground;

service Playground {
rpc SayHello (HelloRequest) returns (HelloReply) {}
}

message HelloRequest {
string name = 1;
}

message HelloReply {
string message = 1;
}